Create a Fully accessed Shared Folder
2014/08/19 |
Install Samba to configure File Server.
For Exmaple, Create a shared directory which everyone can read and write, and authentication is not needed.
|
|
[1] | Configure Samba. |
[root@smb ~]#
[root@smb ~]# yum -y install samba4 samba4-client mkdir /home/share [root@smb ~]# chmod 777 /home/share
[root@smb ~]#
vi /etc/samba/smb.conf # near line 66: add follows unix charset = UTF-8
# line 87: change (Windows' default) workgroup = WORKGROUP
# line 93: uncomment and change IP address you allow hosts allow = 127. 10.0.0.
# line 120: change (no auth) security = user passdb backend = tdbsam
map to guest = Bad User
# add follows to the end [Share]
# any name you like path = /home/share # shared directory writable = yes # writable guest ok = yes # guest OK guest only = yes # guest only create mode = 0777 # fully accessed directory mode = 0777 # fully accessed /etc/rc.d/init.d/smb start [root@smb ~]# /etc/rc.d/init.d/nmb start [root@smb ~]# chkconfig smb on [root@smb ~]# chkconfig nmb on |
[2] | If IPTables is running, allow Samba ports. For "-I INPUT 5" section below, Replace it to your own environment. |
[root@smb ~]# iptables -I INPUT 5 -p tcp -m state --state NEW -m multiport --dports 139,445 -j ACCEPT [root@smb ~]# iptables -I INPUT 5 -p udp -m state --state NEW -m udp --dport 137 -j ACCEPT |
[3] | If SELinux is enabled, change SELinux context. |
[root@smb ~]# setsebool -P samba_enable_home_dirs on [root@smb ~]# restorecon -R /home/share |
[4] | It's the way to access to the shared directory from Windows clients. This example is on Windows 10. Select [My Computer] - [Map Network Drive]. |
[5] | Specify the shared folder's place in Folder section like example and Click 'Finish' button to enter. |
[6] | Just accessed to the shared folder. |